package com.ibuonline.b2b.model;

import java.io.File;

import com.dimeng.common.util.StringUtil;
import com.ibuonline.b2b.common.Constants;
import com.ibuonline.b2b.common.ResourceUtil;

public class UpLoadImage {
	private int id;
	private String url;
	private File banerImage;
	private String banerImageFileName;
	private String banerImageContentType;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public File getBanerImage() {
		return banerImage;
	}
	public void setBanerImage(File banerImage) {
		this.banerImage = banerImage;
	}
	public String getBanerImageFileName() {
		return banerImageFileName;
	}
	public void setBanerImageFileName(String banerImageFileName) {
		this.banerImageFileName = banerImageFileName;
	}
	public String getBanerImageContentType() {
		return banerImageContentType;
	}
	public void setBanerImageContentType(String banerImageContentType) {
		this.banerImageContentType = banerImageContentType;
	}
	
	public String getShowBanner() {
		if(StringUtil.notEmpty(url)) {
			return ResourceUtil.getResPath(url);
		} else {
			return "/images/"+Constants.SHOP_NO_BANNER;
		}
	}
	
}
